package com.autumn.oauth2.zero.configuration;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.oauth2.provider.token.DefaultTokenServices;

import com.autumn.oauth2.zero.provider.endpoint.AccountEndpoint;
import com.autumn.oauth2.zero.provider.endpoint.RevokeTokenEndpoint;

/**
 * 授权端点配置
 * 
 * @author 老码农 2018-04-13 17:38:11
 */
@Configuration
public class AuthorizationServerEndpointConfiguration {

	@Autowired
	@Qualifier(BeanConsts.AUTUMN_TOKEN_SERVICES)
	private DefaultTokenServices autumnTokenServices;

	@Bean
	public RevokeTokenEndpoint revokeTokenEndpoint() {
		return new RevokeTokenEndpoint(this.autumnTokenServices);
	}

	@Bean
	public AccountEndpoint accountEndpoint() {
		return new AccountEndpoint();
	}
}
